<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表-thymeleaf</title>
</head>
<body>
<table>
    <tr>
        <th>用户编号</th>
        <th>用户名</th>
        <th>真实姓名</th>
    </tr>
    <!--th:each="遍历的对象:${后台属性名}"表示遍历-->
    <tr th:each="user:${pageInfo.list}">
        <!--th:text表示取值。并且将值显示在双标签中-->
        <td th:text="${user.userId}"></td>
        <td th:text="${user.userName}"></td>
        <td th:text="${user.realName}"></td>
        <a th:href="@{selectUserById(${user.userId})}">修改</a>
        <!--表单元素使用th:value取值并且将值显示出来-->
        <input type="text" name="loginname" th:value="${user.userName}"/>
    </tr>
<div>
    <a th:if="${pageInfo.hasPreviousPage}" th:href="@{selectUsers.do(pageNum=${pageInfo.pageNum}-1)}">上一页</a>
    <a th:if="${pageInfo.hasNextPage}" th:href="@{selectUsers.do(pageNum=${pageInfo.pageNum}+1)}">下一页</a>
    &emsp;&emsp;&emsp;&emsp;
    <a th:each="page_num:${pageInfo.navigatepageNums}" th:if="${pageInfo.pageNum}==page_num" th:href="@{#}" th:text="${page_num}"></a>
    <a th:each="page_num:${pageInfo.navigatepageNums}" th:if="${pageInfo.pageNum}!=page_num" th:href="@{selectUsers.do(pageNum=${page_num})}" th:text="${page_num}"></a>

</div>

</table>
</body>
</html>